﻿import {FindAll,findPageCondition} from "../../../api/Promotion/Marketing";
let brand={
    data() {
        return {
            marketingFindClaim:{
                marketingId:"",
                marketingName:"",
                marketingDate:"",
                marketingApprovalstatus:"",
                rewardWay:"",
                current: 1, //页数
                size: 8,  //每页条数
            },

            pageDate:[], //分页数据内容
            totalPage:0,  //总页数

        };
    },
    methods: {
        findPage(){ //查询所有
            FindAll().then(response=>{
                this.totalPage = response.total;
                this.pageDate = response;
            })
        },
        findPageCondition(){  //分页条件查询
            findPageCondition(this.marketingFindClaim).then(response=>{
                this.totalPage = response.total;
                this.pageDate = response.data;
            })
        },
        rest(){  //复位
            this.marketingFindClaim.promotionName="";
            this.marketingFindClaim.marketingDate="";
            this.marketingFindClaim.marketingApprovalstatus="";
            this.marketingFindClaim.rewardWay="";
        },
        pagefind(aaa){
            this.marketingFindClaim.current = aaa;
            this.findPageCondition();
        },
        addMarketing(){  //添加单子
            this.$router.push({
                path:"/MarketingApply",
            })
        },
        updateMarketing(){
            this.$router.push({
                path:"/MarketingApply",
            })
        }
    },

    created(){
        this.findPageCondition();
    }
};

export default brand;

